package com.gtallinone.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Grid;

public class OtherPanel extends VerticalPanel {
	public OtherPanel(){
		setSize("100%", "100%");
		setBorderWidth(5);
		
		Grid grid = new Grid(4, 3);
		add(grid);
		grid.setSize("114px", "62px");
		
		Label lblTsquare = new Label("T-square");
		lblTsquare.addStyleName("otherLinks");
		grid.setWidget(0, 0, lblTsquare);
		Image image_tsquare = new Image("http://www.inflexwetrust.com/wp-content/uploads/2011/09/IFWT_georgia_tech_t.png");
		grid.setWidget(1, 0, image_tsquare);
		image_tsquare.setSize("200px", "150px");
		
		Label lblOscar = new Label("Oscar");
		lblOscar.addStyleName("otherLinks");
		grid.setWidget(0, 1, lblOscar);
		Image image_oscar = new Image("http://members.fortunecity.com/coolnwo1/logo2.gif");
		grid.setWidget(1, 1, image_oscar);
		image_oscar.setSize("200px", "150px");
		
		Label lblRoomReservation = new Label("Room Reservation");
		lblRoomReservation.addStyleName("otherLinks");
		grid.setWidget(0, 2, lblRoomReservation);
		Image image_room = new Image("http://www.library.gatech.edu/about/event_space/Room%20443.jpg");
		grid.setWidget(1, 2, image_room);
		image_room.setSize("200px", "150px");
		
		Label lblGtMail = new Label("Gt mail");
		lblGtMail.addStyleName("otherLinks");
		grid.setWidget(2, 0, lblGtMail);
		Image image_mail = new Image("http://e-strategyblog.com/blog/wp-content/uploads/2011/05/Email-Icon.jpg");
		grid.setWidget(3, 0, image_mail);
		image_mail.setSize("200px", "150px");
		
		Label lblNextBus = new Label("Next Bus");
		lblNextBus.addStyleName("otherLinks");
		grid.setWidget(2, 1, lblNextBus);
		Image image_bus = new Image("http://www.gatech.edu/greenbuzz/images/splashTransportation.jpg");
		grid.setWidget(3, 1, image_bus);
		image_bus.setSize("200px", "150px");
		
		
		
		image_tsquare.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				HTML link = new HTML("<object data=https://t-square.gatech.edu/portal width=\"100%\" height=\"800\"> <embed src=https://t-square.gatech.edu/portal width=\"100%\" height=\"800\"> </embed> Error: Embedded data could not be displayed. </object>");
				AppPanel.addTab(link, "T-Square");
			}

		});
		
		image_oscar.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				HTML link = new HTML("<object data=https://oscar.gatech.edu/ width=\"100%\" height=\"800\"> <embed src=https://oscar.gatech.edu/ width=\"100%\" height=\"800\"> </embed> Error: Embedded data could not be displayed. </object>");
				AppPanel.addTab(link, "Oscar");
			}

		});
		
		image_room.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				HTML link = new HTML("<object data=https://www.gtevents.gatech.edu/VirtualEMS/ width=\"100%\" height=\"800\"> <embed src=https://www.gtevents.gatech.edu/VirtualEMS/ width=\"100%\" height=\"800\"> </embed> Error: Embedded data could not be displayed. </object>");
				AppPanel.addTab(link, "Room Reservation");
			}

		});
		
		image_mail.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				HTML link = new HTML("<object data=https://mail.gatech.edu/zimbra/mail width=\"100%\" height=\"800\"> <embed src=https://mail.gatech.edu/zimbra/mail width=\"100%\" height=\"800\"> </embed> Error: Embedded data could not be displayed. </object>");
				AppPanel.addTab(link, "GT Mail");
			}

		});
		
		image_bus.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				HTML link = new HTML("<object data=http://www.nextbus.com/predictor/stopSelector.jsp?a=georgia-tech width=\"100%\" height=\"800\"> <embed src=http://www.nextbus.com/predictor/stopSelector.jsp?a=georgia-tech width=\"100%\" height=\"800\"> </embed> Error: Embedded data could not be displayed. </object>");
				AppPanel.addTab(link, "Next Bus");
			}

		});
	}
}
